<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改咨询问答知识库')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-knowledge-edit" th:object="${qaKnowledge}">
            <input name="id" th:field="*{id}"  type="hidden">
            <input name="scenicId"  id="scenicId" th:feld="*{scenicId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">选择景区,不选择代表通用问题：</label>
                <div class="input-group">
                    <input class="form-control" type="text" onclick="selectScenic()" name="scenicName"  th:field="*{scenicName}" id="scenicName" readonly="true" >
                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">关键词，多个用逗号分隔：</label>
                <div class="col-sm-8">
                    <input name="keywords" th:field="*{keywords}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">问题：</label>
                <div class="col-sm-8">
                    <input name="question" th:field="*{question}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">回答内容：</label>
                <div class="col-sm-8">
                    <input name="answer" th:field="*{answer}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否预设问题：0-否，1-是：</label>
                <div class="col-sm-8">
                    <select name="isPreset" class="form-control m-b" th:with="type=${@dict.getType('sys_cove_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isPreset}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "lvyou/knowledge";
        $("#form-knowledge-edit").validate({
            focusCleanup: true
        });

        function selectScenic(){
            $.modal.open("选择景区", prefix + "/selectScenic");
        }

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-knowledge-edit').serialize());
            }
        }
    </script>
</body>
</html>